package com.xls.box2023.adapter;

import android.content.Context;
import android.view.ViewGroup;

import com.lzz.bottomencapsulation.adapter.MvpBaseRecyclerAdapter;
import com.xls.box2023.entity.AppTeamUsersEntity;

import java.util.ArrayList;
import java.util.List;

import androidx.annotation.NonNull;

public class TuiGuangAdapter extends MvpBaseRecyclerAdapter<TuiGuangItemView> {
    ArrayList<AppTeamUsersEntity> appTeamUsersEntities;
    boolean isShowScore=true;
    public TuiGuangAdapter(Context context,ArrayList<AppTeamUsersEntity> appTeamUsersEntities) {
        super(context);
        this.appTeamUsersEntities=appTeamUsersEntities;
    }

    public TuiGuangAdapter(Context context,ArrayList<AppTeamUsersEntity> appTeamUsersEntities, boolean isShowScore) {
        super(context);
        this.appTeamUsersEntities=appTeamUsersEntities;
        this.isShowScore=isShowScore;
    }

    @Override
    public void onBindView(@NonNull TuiGuangItemView holder, int position) {
        holder.setViewData(appTeamUsersEntities.get(position));
        holder.initView();
    }

    @Override
    public void onBindView(TuiGuangItemView holder, int position, List<Object> payloads) {

    }

    @NonNull
    @Override
    public TuiGuangItemView onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new TuiGuangItemView(context,parent,isShowScore);
    }

    @Override
    public int getItemCount() {
        return appTeamUsersEntities.size();
    }

    @Override
    public long getItemId(int position)

    { return position;}

    public int getItemViewType(int position) {
        return position;
    }
}
